package com.wang.exam.service;

import com.wang.exam.mapper.ExamCourseMapper;
import com.wang.exam.pojo.ExamCourses;
import com.wang.exam.pojo.Teacher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class


CourseService {
    @Autowired
    ExamCourseMapper examCourseMapper;
    List<ExamCourses> getExamCourses(int page,int rows){
        return examCourseMapper.getExamCourses((page-1)*rows,rows);
    }

    public List<ExamCourses> getCourseById(Integer course_id){
        List<ExamCourses> examCourses = examCourseMapper.getCourseById(course_id);
        return examCourses;
    }
    public List<ExamCourses> getCourseList(int page,int rows){
        return examCourseMapper.getExamCourses((page-1)*rows,rows);
    }

    public List<ExamCourses> getCourse(String course_id){
        return examCourseMapper.getCourse(course_id);
    }

    public int getCCount(){
        return examCourseMapper.getCount();
    }

    public int deleteId(String [] ids){
        return examCourseMapper.deleteId(ids);
    }

    public int addCourse(ExamCourses examCourses){
        return examCourseMapper.addCourse(examCourses);
    }

    public int updateCourse(Map<String,Object> map){
        return examCourseMapper.updateCourse(map);
    }
    public int deleteCourse(Map<String,Object> map){
        return examCourseMapper.deleteCourse(map);
    }

}
